import http from './index.js'
//管理员登录
let userlogin = (data) => {
    return http.post('/userlogin',data)
}
//菜单列表 设置默认为树形结构传值
let menulist = (istree= true) => {
    return http.get('/menulist',{ params:{ istree } })
}
//菜单添加
let menuadd = (data) => {
    return http.post('/menuadd',data)
}
//菜单获取（一条）
let menuinfo = (id) => {
    return http.get('/menuinfo', { params: { id } })
}
//菜单修改
let menuedit = (data,) => {
    return http.post('/menuedit',data)
}
//菜单删除
let menudelete = (id) => {
    return http.post('/menudelete',{id})
}

//角色列表
let rolelist = () => {
    return http.get('/rolelist')
}
//角色添加
let roleadd = (data) => {
    return http.post('/roleadd',data)
}
//角色获取（一条）
let roleinfo = (id) => {
    return http.get('/roleinfo', { params: { id } })
}
//角色修改
let roleedit = (data) => {
    return http.post('/roleedit',data)
}
//角色删除
let roledelete = (id) => {
    return http.post('/roledelete',{id})
}

//管理员列表
let userlist = (params) => {
    return http.get('/userlist',{params})
}
//管理员总数
let usercount = () => {
    return http.get('/usercount')
}
// 管理员添加
let useradd = (data) => {
    return http.post('/useradd',data)
}
//管理员获取（一条）
let userinfo = (uid) => {
    return http.get('/userinfo', { params: { uid } })
}
//管理员修改
let useredit = (data) => {
    return http.post('/useredit',data)
}
//管理员删除
let userdelete = (uid) => {
    return http.post('/userdelete',{uid})
}

//商品分类列表
let catelist = (istree= true) => {
    return http.get('/catelist',{ params:{ istree } })
}
//商品分类添加
let cateadd = (data) => {
    return http.post('/cateadd',data)
}
//商品分类获取（一条）
let cateinfo = (id) => {
    return http.get('/cateinfo', { params: { id } })
}
//商品分类修改
let cateedit = (data,) => {
    return http.post('/cateedit',data)
}
//商品分类删除
let catedelete = (id) => {
    return http.post('/catedelete',{id})
}

//商品分类列表
let specslist = (params) => {
    return http.get('/specslist',{params})
}
//商品分类总数
let specscount = () => {
    return http.get('/specscount')
}
// 商品分类添加
let specsadd = (data) => {
    return http.post('/specsadd',data)
}
//商品分类获取（一条）
let specsinfo = (id) => {
    return http.get('/specsinfo', { params: { id } })
}
//商品分类修改
let specsedit = (data) => {
    return http.post('/specsedit',data)
}
//商品分类删除
let specsdelete = (id) => {
    return http.post('/specsdelete',{id})
}

//商品管理列表
let goodslist = (params) => {
    return http.get('/goodslist',{params})
}
//商品管理总数
let goodscount = () => {
    return http.get('/goodscount')
}
// 商品管理添加
let goodsadd = (data) => {
    return http.post('/goodsadd',data)
}
//商品管理获取（一条）
let goodsinfo = (id) => {
    return http.get('/goodsinfo', { params: { id } })
}
//商品管理修改
let goodsedit = (data) => {
    return http.post('/goodsedit',data)
}
//商品管理删除
let goodsdelete = (id) => {
    return http.post('/goodsdelete',{id})
}


//会员管理列表
let memberlist = () => {
    // console.log('111');
    return http.get('/memberlist')
}
//会员管理获取（一条）
let memberinfo = (uid) => {
    return http.get('/memberinfo', { params: { uid } })
}
//会员管理修改
let memberedit = (data) => {
    return http.post('/memberedit',data)
}

//轮播图列表
let bannerlist = () => {
    return http.get('/bannerlist')
}
//轮播图添加
let banneradd = (data) => {
    return http.post('/banneradd',data)
}
//轮播图获取（一条）
let bannerinfo = (id) => {
    return http.get('/bannerinfo', { params: { id } })
}
//轮播图修改
let banneredit = (data) => {
    return http.post('/banneredit',data)
}
//轮播图删除
let bannerdelete = (id) => {
    return http.post('/bannerdelete',{id})
}

//秒杀活动列表
let secklist = () => {
    return http.get('/secklist')
}
//秒杀活动添加
let seckadd = (data) => {
    return http.post('/seckadd',data)
}
//秒杀活动获取（一条）
let seckinfo = (id) => {
    return http.get('/seckinfo', { params: { id } })
}
//秒杀活动修改
let seckedit = (data) => {
    return http.post('/seckedit',data)
}
//秒杀活动删除
let seckdelete = (id) => {
    return http.post('/seckdelete',{id})
}

export {
    userlogin,
    menulist,
    menuadd,
    menuinfo,
    menuedit,
    menudelete,
    rolelist,
    roleadd,
    roleinfo,
    roleedit,
    roledelete,
    userlist,
    useradd,
    userinfo,
    useredit,
    userdelete,
    usercount,
    catelist,
    cateadd,
    cateinfo,
    cateedit,
    catedelete,
    specslist,
    specsadd,
    specsinfo,
    specsedit,
    specsdelete,
    specscount,
    goodslist,
    goodsadd,
    goodsinfo,
    goodsedit,
    goodsdelete,
    goodscount,
    memberlist,
    memberinfo,
    memberedit,
    bannerlist,
    banneradd,
    bannerinfo,
    banneredit,
    bannerdelete,
    secklist,
    seckadd,
    seckinfo,
    seckedit,
    seckdelete,
}

